#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>


char* stristr(const char* haystack, const char* needle){
	int i,j;
	short quit=1;
	int diff;
	
	if(!haystack || !needle || (diff=strlen(haystack)-strlen(needle))<0)
		return 0;

	for(i=0;i<diff;i++){
		quit=0;
		for(j=0;j<strlen(needle);j++){
			if(toupper(needle[j])!=toupper(haystack[i+j])){
				quit=1;
				break;
			}
		}
		if(!quit){
			return &haystack[i];
		}
	}
	return 0;
}

int main (int argv, char** argc){
	
	//char *x=stristr("hello connection establishe, "masterf");
	//if(x)
	//	printf("%s\n",x);
	char hello[10];

	memset(hello, 'a', 10);


	printf("%s %d\n", hello, strlen(hello));
}

